﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScreenList.aspx.cs" Inherits="FSS.Module.List.ScreenList" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/Controls/List/ScreenForm.ascx" TagName="WindowEditor" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript">
        function DocumentReady() {
            MethodNamespace.DocumentReady({
                success: function() {

                }
            });
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager" runat="server" DirectMethodNamespace="MethodNamespace">
        <Listeners>
            <DocumentReady Handler="DocumentReady();" />
        </Listeners>
    </ext:ResourceManager>
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:GridPanel ID="grdMain" runat="server" StripeRows="true" TrackMouseOver="true"
                AutoExpandColumn="ScreenName" Border="false" Region="Center">
                <TopBar>
                    <ext:Toolbar ID="tbMain" runat="server">
                        <Items>
                            <ext:ToolbarSpacer />
                            <ext:Button ID="btnAdd" runat="server" Text="Tạo mới" Icon="TableAdd">
                                <DirectEvents>
                                    <Click OnEvent="btnAdd_Click" />
                                </DirectEvents>
                            </ext:Button>
                            <ext:ToolbarSpacer />
                            <ext:ToolbarFill />
                            <ext:TextField ID="txtKeyword" runat="server" EmptyText="Tìm kiếm" />
                            <ext:ToolbarSpacer />
                            <ext:Button ID="btnFind" runat="server" Text="Tìm kiếm" Icon="Find">
                                <DirectEvents>
                                    <Click OnEvent="btnFind_Click" />
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Store>
                    <ext:Store ID="storeMain" runat="server" GroupField="Module">
                        <Reader>
                            <ext:JsonReader>
                                <Fields>
                                    <ext:RecordField Name="ScreenId" />
                                    <ext:RecordField Name="ScreenName" />
                                    <ext:RecordField Name="Icon" />
                                    <ext:RecordField Name="FileName" />
                                    <ext:RecordField Name="Note" />
                                    <ext:RecordField Name="Parent" />
                                    <ext:RecordField Name="Module" />
                                    <ext:RecordField Name="Extention" />
                                    <ext:RecordField Name="DisplayOrder" />
                                    <ext:RecordField Name="IsActive" />
                                    <ext:RecordField Name="Deleted" />
                                    <ext:RecordField Name="CreatedDate" />
                                    <ext:RecordField Name="CreatedBy" />
                                    <ext:RecordField Name="UpdatedDate" />
                                    <ext:RecordField Name="UpdatedBy" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column ColumnID="ScreenId" DataIndex="ScreenId" Header="ScreenId" />
                        <ext:Column ColumnID="ScreenName" DataIndex="ScreenName" Header="ScreenName" />
                        <ext:Column ColumnID="Icon" DataIndex="Icon" Header="Icon" />
                        <ext:Column ColumnID="FileName" DataIndex="FileName" Header="FileName" />
                        <ext:Column ColumnID="Note" DataIndex="Note" Header="Note" />
                        <ext:Column ColumnID="Parent" DataIndex="Parent" Header="Parent" />
                        <ext:Column ColumnID="Module" DataIndex="Module" Header="Module" />
                        <ext:Column ColumnID="Extention" DataIndex="Extention" Header="Extention" />
                        <ext:Column ColumnID="DisplayOrder" DataIndex="DisplayOrder" Header="DisplayOrder" />
                        <ext:CommandColumn Width="75">
                            <Commands>
                                <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="Cập nhật">
                                </ext:GridCommand>
                            </Commands>
                        </ext:CommandColumn>
                        <ext:CommandColumn Width="60" ButtonAlign="Center">
                            <Commands>
                                <ext:GridCommand Icon="NoteDelete" CommandName="Delete" Text="Xóa">
                                </ext:GridCommand>
                            </Commands>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                <DirectEvents>
                    <Command OnEvent="grdMain_OnCommand">
                        <ExtraParams>
                            <ext:Parameter Name="command" Value="command" Mode="Raw" />
                            <ext:Parameter Name="id" Value="record.data.ScreenId" Mode="Raw" />
                        </ExtraParams>
                        <Confirmation ConfirmRequest="true" Message="Bạn có thật sự muốn xóa dòng dữ liệu này không?"
                            Title="Thông báo" BeforeConfirm="if (command=='Edit') return false;" />
                    </Command>
                </DirectEvents>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
                </SelectionModel>
                <View>
                    <ext:GroupingView ID="GroupingView1" HideGroupedColumn="true" runat="server" ForceFit="true"
                        EnableRowBody="true" MarkDirty="false">
                    </ext:GroupingView>
                </View>
                <BottomBar>
                    <ext:PagingToolbar ID="paddingBar" StoreID="storeMain" runat="server" PageSize="100"
                        DisplayInfo="true" DisplayMsg="Đang xem dòng {0} đến {1} của {2}" EmptyMsg="Không có dữ liệu">
                    </ext:PagingToolbar>
                </BottomBar>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    <uc:WindowEditor ID="WindowEditor" runat="server" />
    </form>
</body>
</html>
